﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace IDE_week2ChangeLanguage
{
    public partial class Form1 : Form
    {

        String language;
        public Form1()
        {
            InitializeComponent();
            language = "nl";
        }
        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void btnchangelanguage_Click(object sender, EventArgs e)
        {
            if (language =="nl")
            {
                ChangeLanguage(language);

                language = "en";
            }
            else
            {
                ChangeLanguage(language);

                language = "nl";
            }
        }
    }
}
